<?php

require_once('../../auth/auth.php');

//get values from POST
	$title=$_POST['title'];        
	$firstname=$_POST['firstname'];    
 	$lastname=$_POST['lastname'];    
	$age=$_POST['age'];    
	$primary_disease=$_POST['primary_disease'];    
	$gender=$_POST['gender'];    
	$zipcode=$_POST['zipcode'];    
	$admitted_on= "DATE_FORMAT(CURDATE(),'%m-%d-%Y')";  
	//$readmission_risk=$_POST['readmission_risk'];
	$readmission_risk="YES";    
	$username= $_SESSION['SESS_MEMBER_USERNAME'];
 
include 'db_Connect.php';

$patient = "INSERT INTO patients 
			(title, firstname, lastname, age, primary_disease, gender, zipcode, admitted_on, readmission_risk, owned_by)
		VALUES
         ('$title', '$firstname', '$lastname', '$age', '$primary_disease', '$gender','$zipcode',$admitted_on, '$readmission_risk', '$username'         
)";


$result = mysql_query($patient);	
if($result){
	echo("<br>Patient add succeed");
	header("Location:../index.php");
} else{
	echo("<br> Patient add failed");
}

include 'db_Close.php';

?>

